import React  from 'react';
import { connect } from 'react-redux';
import * as ConfigActions from '../actions/config.js';
function AppContainer(props){
  React.useEffect(()=>{
    props.dispatch(ConfigActions.loadConfig());
  },[])
    const { children, config } = props;
    return (
      <div className="ui">
        {config.isLoaded ? children : null}
      </div>
    );
}
function mapStateToProps(state) {
  return {
    config: state.config,
  };
}


export default connect(mapStateToProps)(AppContainer);

